//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.smartstate.dataManagement.entity;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.List;

public class PageQuery<T> implements Serializable {
    @ApiModelProperty("当前页数默认为1")
    private Integer current;
    @ApiModelProperty("每页大小默认为100000")
    private Integer pageSize;
    @ApiModelProperty("是否正序排列，默认 true")
    List<OrderItem> orders;

    public Page<T> initPage() {
        Integer currentPage = this.getCurrent() == null ? 1 : this.getCurrent();
        Integer pageSize = this.getPageSize() == null ? 100000 : this.getPageSize();
        Page<T> tPage = new Page((long)currentPage, (long)pageSize);
        tPage.setOrders(this.orders);
        return tPage;
    }

    public PageQuery() {
    }

    public Integer getCurrent() {
        return this.current;
    }

    public Integer getPageSize() {
        return this.pageSize;
    }

    public List<OrderItem> getOrders() {
        return this.orders;
    }

    public void setCurrent(final Integer current) {
        this.current = current;
    }

    public void setPageSize(final Integer pageSize) {
        this.pageSize = pageSize;
    }

    public void setOrders(final List<OrderItem> orders) {
        this.orders = orders;
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof PageQuery)) {
            return false;
        } else {
            PageQuery<?> other = (PageQuery)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                label47: {
                    Object this$current = this.getCurrent();
                    Object other$current = other.getCurrent();
                    if (this$current == null) {
                        if (other$current == null) {
                            break label47;
                        }
                    } else if (this$current.equals(other$current)) {
                        break label47;
                    }

                    return false;
                }

                Object this$pageSize = this.getPageSize();
                Object other$pageSize = other.getPageSize();
                if (this$pageSize == null) {
                    if (other$pageSize != null) {
                        return false;
                    }
                } else if (!this$pageSize.equals(other$pageSize)) {
                    return false;
                }

                Object this$orders = this.getOrders();
                Object other$orders = other.getOrders();
                if (this$orders == null) {
                    if (other$orders != null) {
                        return false;
                    }
                } else if (!this$orders.equals(other$orders)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof PageQuery;
    }

    public int hashCode() {
//        int PRIME = true;
        int result = 1;
        Object $current = this.getCurrent();
        result = result * 59 + ($current == null ? 43 : $current.hashCode());
        Object $pageSize = this.getPageSize();
        result = result * 59 + ($pageSize == null ? 43 : $pageSize.hashCode());
        Object $orders = this.getOrders();
        result = result * 59 + ($orders == null ? 43 : $orders.hashCode());
        return result;
    }

    public String toString() {
        Integer var10000 = this.getCurrent();
        return "PageQuery(current=" + var10000 + ", pageSize=" + this.getPageSize() + ", orders=" + this.getOrders() + ")";
    }
}
